<!DOCTYPE html>
<html>
<head>
<!--
http://cdn.jsdelivr.net/jquery/2.1.1/jquery.min.js
http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js

-->
<title>Hossam Elbadawy jQuery</title>
<meta charset="UTF-8"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">

$(function() {

$('.iframe').attr('src',function(i,e){return e.replace("http://img.youtube.com/vi/","https://www.youtube.com/embed/");});
$('.iframe').attr('src',function(i,e){return e.replace("/0.jpg","");});

$('img').click (function() {

$('#loader').fadeIn(1000);

}):

});

</script>
<style type="text/css">
#loader {
position: fixed;
width: 100%;
height: 100%;
z-index: 999999999999999;
top: 0;
left: 0;
right: 0;
bottom: 0;
text-align: center;
display:none;
background-color: rgba(0, 0, 0, 0.7);
color: #fff;
}
.iframe {
width: 700px;
height:400px;
padding:20px;
background:#fff;
}
</style>
</head>
<body>

<img src="http://img.youtube.com/vi/M7FIvfx5J10/0.jpg" />


<div id="loader">
<iframe class="iframe" src="http://img.youtube.com/vi/M7FIvfx5J10/0.jpg" />
</div>
</body>
</html>